package com.yict.csms.system.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.yict.common.dao.impl.CommonDao;
import com.yict.csms.system.entity.BudgetNum;
import com.yict.csms.system.entity.Holiday;

/**
 * 
 * 
 * @author Patrick.Deng
 * 
 */
@Repository
public class BudgetNumDaoImpl extends CommonDao<BudgetNum, Long> {
	
	public List<String> findAllType() {
		List<String> list = new ArrayList<String>();
		String queryString = "select c.budType from BudgetNum as c where 1=1 order by c.createDate desc";
		try {
			Query query = this.getSession().createQuery(queryString);
			list = query.list();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}
	
	public BudgetNum findById(Long id) {
		return (BudgetNum)this.getTemplate().get(BudgetNum.class, id);
	}

}
